﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">

    <title>Preclinic - Medical & Hospital - Bootstrap 4 Admin Template</title>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="static/assets/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/fullcalendar.min.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/dataTables.bootstrap4.min.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/select2.min.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/style.css">
    <link rel="stylesheet" type="text/css" href="static/assets/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="static/layui/css/layui.css">
    <!--[if lt IE 9]>
    <script src="static/static/assets/js/html5shiv.min.js"></script>
    <script src="static/static/assets/js/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="main-wrapper">
    <div class="header">
        <div class="header-left">
            <a href="index.html" class="logo">
                <img src="static/assets/img/logo.png" width="35" height="35" alt=""> <span>护士</span>
            </a>
        </div>
        <a id="toggle_btn" href="javascript:void(0);"><i class="fa fa-bars"></i></a>
        <a id="mobile_btn" class="mobile_btn float-left" href="#sidebar"><i class="fa fa-bars"></i></a>
        <ul class="nav user-menu float-right">
            <li class="nav-item dropdown d-none d-sm-block">
                <a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown"><i class="fa fa-bell-o"></i> <span
                        class="badge badge-pill bg-danger float-right">3</span></a>
                <div class="dropdown-menu notifications">
                    <div class="topnav-dropdown-header">
                        <span>Notifications</span>
                    </div>
                    <div class="drop-scroll">
                        <ul class="notification-list">
                            <li class="notification-message">
                                <a href="activities.html">
                                    <div class="media">
											<span class="avatar">
												<img alt="John Doe" src="static/assets/img/user.jpg" class="img-fluid">
											</span>
                                        <div class="media-body">
                                            <p class="noti-details"><span class="noti-title">John Doe</span> added new
                                                task <span class="noti-title">Patient appointment booking</span></p>
                                            <p class="noti-time"><span class="notification-time">4 mins ago</span></p>
                                        </div>
                                    </div>
                                </a>
                            </li>
                            <li class="notification-message">
                                <a href="activities.html">
                                    <div class="media">
                                        <span class="avatar">V</span>
                                        <div class="media-body">
                                            <p class="noti-details"><span class="noti-title">Tarah Shropshire</span>
                                                changed the task name <span class="noti-title">Appointment booking with payment gateway</span>
                                            </p>
                                            <p class="noti-time"><span class="notification-time">6 mins ago</span></p>
                                        </div>
                                    </div>
                                </a>
                            </li>
                            <li class="notification-message">
                                <a href="activities.html">
                                    <div class="media">
                                        <span class="avatar">L</span>
                                        <div class="media-body">
                                            <p class="noti-details"><span class="noti-title">Misty Tison</span> added
                                                <span class="noti-title">Domenic Houston</span> and <span
                                                        class="noti-title">Claire Mapes</span> to project <span
                                                        class="noti-title">Doctor available module</span></p>
                                            <p class="noti-time"><span class="notification-time">8 mins ago</span></p>
                                        </div>
                                    </div>
                                </a>
                            </li>
                            <li class="notification-message">
                                <a href="activities.html">
                                    <div class="media">
                                        <span class="avatar">G</span>
                                        <div class="media-body">
                                            <p class="noti-details"><span class="noti-title">Rolland Webber</span>
                                                completed task <span class="noti-title">Patient and Doctor video conferencing</span>
                                            </p>
                                            <p class="noti-time"><span class="notification-time">12 mins ago</span></p>
                                        </div>
                                    </div>
                                </a>
                            </li>
                            <li class="notification-message">
                                <a href="activities.html">
                                    <div class="media">
                                        <span class="avatar">V</span>
                                        <div class="media-body">
                                            <p class="noti-details"><span class="noti-title">Bernardo Galaviz</span>
                                                added new task <span class="noti-title">Private chat module</span></p>
                                            <p class="noti-time"><span class="notification-time">2 days ago</span></p>
                                        </div>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </div>
                    <div class="topnav-dropdown-footer">
                        <a href="activities.html">View all Notifications</a>
                    </div>
                </div>
            </li>
            <li class="nav-item dropdown d-none d-sm-block">
                <a href="javascript:void(0);" id="open_msg_box" class="hasnotifications nav-link"><i
                        class="fa fa-comment-o"></i> <span class="badge badge-pill bg-danger float-right">8</span></a>
            </li>
            <li class="nav-item dropdown has-arrow">
                <a href="#" class="dropdown-toggle nav-link user-link" data-toggle="dropdown">
                        <span class="user-img">
							<img class="rounded-circle" src="static/assets/img/user.jpg" width="24" alt="Admin">
							<span class="status online"></span>
						</span>
                    <span>Admin</span>
                </a>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="#">修改个人信息</a>
                    <a class="dropdown-item" href="loginout">退出</a>
                </div>
            </li>
        </ul>
        <div class="dropdown mobile-user-menu float-right">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i
                    class="fa fa-ellipsis-v"></i></a>
            <div class="dropdown-menu dropdown-menu-right">
                <a class="dropdown-item" href="profile.html">My Profile</a>
                <a class="dropdown-item" href="edit-profile.html">Edit Profile</a>
                <a class="dropdown-item" href="settings.html">Settings</a>
                <a class="dropdown-item" href="login.html">Logout</a>
            </div>
        </div>
    </div>
    <div class="sidebar" id="sidebar">
        <div class="sidebar-inner slimscroll">
            <div id="sidebar-menu" class="sidebar-menu">
                <ul>
                    <li class="menu-title">Main</li>
                    <li>
                        <a href="javascript:;"><i class="fa fa-calendar-check-o"></i> <span>处理申请</span></a>
                    </li>
                    <li>
                        <a href="javascript:;" id="chatBtn"><i class="fa fa-comments"></i> <span>聊天</span></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="page-wrapper" id="allContentDiv">
        <div class="content">
            <canvas id="bargraph"></canvas>
            <canvas id="linegraph"></canvas>
            <div class="row">
                <div class="col-md-12">
                    <div class="card-box">
                        <form action="#">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>申请类型</label>
                                        <select class="select" id="querySelectType">
                                            <option value="inHospitalApply">住院申请</option>
                                            <option value="drugApply">药品申请</option>
                                            <option value="outHospitalApply">出院申请</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="text-left">
                                <button type="button" class="btn btn-primary" id="queryBtn">查询</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <!--            这是查询出来的表格-->
            <div class="row" id="inHospitalInfoDiv">
                <div class="col-md-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="table-responsive">
                                    <table class="table table-striped custom-table mb-0 datatable">
                                        <thead>
                                        <tr>
                                            <th>住院id</th>
                                            <th>患者姓名</th>
                                            <th>患者性别</th>
                                            <th>科室名</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="inHospitalApplyInfoTbody">

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" id="outHospitalInfoDiv">
                <div class="col-md-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="table-responsive">
                                    <table class="table table-striped custom-table mb-0 datatable">
                                        <thead>
                                        <tr>
                                            <th>住院id</th>
                                            <th>患者姓名</th>
                                            <th>患者性别</th>
                                            <th>科室名</th>
                                            <th>住院类型</th>
                                            <th>入院时间</th>
                                            <th>住院时长</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="outHospitalApplyInfoTbody">

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" id="drugApplyInfoDiv">
                <div class="col-md-12">
                    <div class="card-box">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="table-responsive">
                                    <table class="table table-striped custom-table mb-0 datatable">
                                        <thead>
                                        <tr>
                                            <th>药品id</th>
                                            <th>药品名称</th>
                                            <th>患者姓名</th>
                                            <th>患者性别</th>
                                            <th>科室名</th>
                                            <th>药品需求</th>
                                            <th>申请数量</th>
                                            <th>申请时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="drugApplyInfoTbody">

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" id="infoWriteTable">
                <div class="col-md-12">
                    <form action="">
                        <div class="card-box">
                            <div class="row">
                                <div class="col-md-6">
                                    <h1 class="card-title" style="font-size: 30px">住院表</h1>
                                    <div class="form-group row">
                                        <label class="col-lg-3 col-form-label">患者姓名:</label>
                                        <div class="col-lg-5">
                                            <input type="text" class="form-control" name="patientName" disabled>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-lg-3 col-form-label">住院类型</label>
                                        <div class="col-lg-9">
                                            <select class="select" name="hospitalizationType">
                                                <option value="普通住院">普通住院</option>
                                                <option value="重症监护">重症监护</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group row">
                                        <label class="col-lg-3 col-form-label">科室信息:</label>
                                        <div class="col-lg-9">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <input type="text" placeholder="科室ID" class="form-control"
                                                           name="sectionId" disabled>
                                                </div>
                                                <div class="col-md-6">
                                                    <input type="text" placeholder="科室名" class="form-control"
                                                           name="sectionName" disabled>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-lg-3 col-form-label">可选床位:</label>
                                        <div class="col-lg-9">
                                            <div class="row">
                                                <div class="col-md-6">
                                                    <div class=" m-b-20">
                                                        <select class="select" name="wardId" id="wardSelect">

                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-md-6">
                                                    <select class="select" name="sickbedCode">

                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="col-lg-3 col-form-label">住院日期:</label>
                                                <div class="col-md-6">
                                                    <div class="cal-icon">
                                                        <input type="text" class="layui-input" id="test5"
                                                               placeholder="yyyy-MM-dd HH:mm:ss"
                                                               name="hospitalizationTime" required>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label class="col-lg-3 col-form-label">住院时长:</label>
                                                <div class="col-md-6">
                                                    <input class="form-control" type="number" name="hospitalizationDate"
                                                           required>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="text-right">
                                <input type="hidden" name="infoTableTrId" value="">
                                <input type="hidden" name="medicalId" value="">
                                <input type="hidden" name="patientId" value="">
                                <input type="hidden" name="hospitalApplyId" value="">
                                <button type="button" class="btn btn-primary backBtn">返回</button>
                                <button type="button" class="btn btn-primary commitBtn">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="notification-box">
            <div class="msg-sidebar notifications msg-noti">
                <div class="topnav-dropdown-header">
                    <span>Messages</span>
                </div>
                <div class="drop-scroll msg-list-scroll" id="msg_list">
                    <ul class="list-box">
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">R</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Richard Miles </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item new-message">
                                    <div class="list-left">
                                        <span class="avatar">J</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">John Doe</span>
                                        <span class="message-time">1 Aug</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">T</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Tarah Shropshire </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">M</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Mike Litorus</span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">C</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Catherine Manseau </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">D</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Domenic Houston </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">B</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Buster Wigton </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">R</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Rolland Webber </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">C</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author"> Claire Mapes </span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">M</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Melita Faucher</span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">J</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Jeffery Lalor</span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">L</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Loren Gatlin</span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a href="chat.html">
                                <div class="list-item">
                                    <div class="list-left">
                                        <span class="avatar">T</span>
                                    </div>
                                    <div class="list-body">
                                        <span class="message-author">Tarah Shropshire</span>
                                        <span class="message-time">12:28 AM</span>
                                        <div class="clearfix"></div>
                                        <span class="message-content">Lorem ipsum dolor sit amet, consectetur adipiscing</span>
                                    </div>
                                </div>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="topnav-dropdown-footer">
                    <a href="chat.html">See all messages</a>
                </div>
            </div>
        </div>
    </div>
    <div class="page-wrapper" id="chatBox">
        <div class="chat-main-row">
            <div class="chat-main-wrapper">
                <div class="col-lg-9 message-view chat-view">
                    <div class="chat-window">
                        <div class="chat-contents">

                        </div>
                        <div class="chat-footer">
                            <div class="message-bar">
                                <div class="message-inner">
                                    <a class="link attach-icon" href="#" data-toggle="modal"
                                       data-target="#drag_files"><img src="static/assets/img/attachment.png" alt=""></a>
                                    <div class="message-area">
                                        <div class="input-group">
                                            <textarea class="form-control" placeholder="Type message..."
                                                      v-model="inputContent"></textarea>
                                            <span class="input-group-append">
													<button class="btn btn-primary" type="button"
                                                            @click="sentInputMessage"><i
                                                            class="fa fa-send"></i></button>
												</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3 message-view chat-profile-view chat-sidebar" id="chat_sidebar">
                    <div class="chat-window video-window">
                        <div class="tab-content chat-contents">
                            <div class="content-full tab-pane" id="calls_tab">
                                <div class="chat-wrap-inner">
                                    <div class="chat-box">
                                        <div class="chats">
                                            <div class="chat chat-left">
                                                <div class="chat-avatar">
                                                    <a href="profile.html" class="avatar">
                                                        <img alt="Cristina Groves"
                                                             src="static/assets/img/doctor-thumb-03.jpg"
                                                             class="img-fluid rounded-circle">
                                                    </a>
                                                </div>
                                                <div class="chat-body">
                                                    <div class="chat-bubble">
                                                        <div class="chat-content">
                                                            <span class="chat-user">You</span> <span class="chat-time">8:35 am</span>
                                                            <div class="call-details">
                                                                <i class="material-icons">phone_missed</i>
                                                                <div class="call-info">
                                                                    <div class="call-user-details">
                                                                        <span class="call-description">Jeffrey Warden missed the call</span>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="chat chat-left">
                                                <div class="chat-avatar">
                                                    <a href="profile.html" class="avatar">
                                                        <img alt="Jennifer Robinson"
                                                             src="static/assets/img/patient-thumb-02.jpg"
                                                             class="img-fluid rounded-circle">
                                                    </a>
                                                </div>
                                                <div class="chat-body">
                                                    <div class="chat-bubble">
                                                        <div class="chat-content">
                                                            <span class="chat-user">Jennifer Robinson</span> <span
                                                                class="chat-time">8:35 am</span>
                                                            <div class="call-details">
                                                                <i class="material-icons">call_end</i>
                                                                <div class="call-info">
                                                                    <div class="call-user-details"><span
                                                                            class="call-description">This call has ended</span>
                                                                    </div>
                                                                    <div class="call-timing">Duration: <strong>5 min 57
                                                                        sec</strong></div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="chat-line">
                                                <span class="chat-date">January 29th, 2015</span>
                                            </div>
                                            <div class="chat chat-left">
                                                <div class="chat-avatar">
                                                    <a href="profile.html" class="avatar">
                                                        <img alt="Cristina Groves"
                                                             src="static/assets/img/doctor-thumb-03.jpg"
                                                             class="img-fluid rounded-circle">
                                                    </a>
                                                </div>
                                                <div class="chat-body">
                                                    <div class="chat-bubble">
                                                        <div class="chat-content">
                                                            <span class="chat-user">You</span> <span class="chat-time">8:35 am</span>
                                                            <div class="call-details">
                                                                <i class="material-icons">ring_volume</i>
                                                                <div class="call-info">
                                                                    <div class="call-user-details">
                                                                        <a href="#"
                                                                           class="call-description call-description--linked"
                                                                           data-qa="call_attachment_link">Calling
                                                                            Jennifer ...</a>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="content-full tab-pane show active" id="profile_tab">
                                <div class="display-table">
                                    <div class="table-row">
                                        <div class="table-body">
                                            <div class="table-content">
                                                <h3>选择聊天部门</h3>
                                                <div>
                                                    <input type='button' class='btn btn-primary' value="门诊部"
                                                           @click="getCallAction(9005)"/>
                                                    <input type='button' class='btn btn-primary' value="财务部"
                                                           @click="getCallAction(9003)"/>
                                                    <input type='button' class='btn btn-primary' value="挂号部"
                                                           @click="getCallAction(9002)"/>
                                                    <input type='button' class='btn btn-primary' value="手术部"
                                                           @click="getCallAction(9001)"/>
                                                </div>
                                                <div style="margin-top: 10px">
                                                    <input type='button' class='btn btn-primary' value="住院部"
                                                           @click="getCallAction(9006)"/>
                                                </div>
                                                <div style="margin-top: 510px">
                                                    <input type='button' class='btn btn-primary closeCallBox'
                                                           value="关闭聊天"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="sidebar-overlay" data-reff=""></div>
<script src="static/assets/js/jquery-3.2.1.min.js"></script>
<script src="static/assets/js/popper.min.js"></script>
<script src="static/assets/js/bootstrap.min.js"></script>
<script src="static/assets/js/jquery.slimscroll.js"></script>
<script src="static/assets/js/select2.min.js"></script>
<script src="static/assets/js/app.js"></script>
<script src="static/assets/js/jquery.dataTables.min.js"></script>
<script src="static/assets/js/jquery.slimscroll.js"></script>
<script src="static/assets/js/dataTables.bootstrap4.min.js"></script>
<script src="static/assets/js/moment.min.js"></script>
<script src="static/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="static/layui/layui.all.js"></script>
<script src="static/vue.js"></script>
<script>
    var queryResult;
    var queryOutResult;
    var queryDrugApply;
    //查询出住院申请表中所有未处理状态为false的信息
    $.ajax({
        url: "tao-inHospitalApplyQuery",
        type: "post",
        dataType: "Json",
        async: true,
        success: function (result) {
            console.log(result);
            queryResult = result;
            for (var i = 0; i < result.length; i++) {
                var queryResultTr = $("<tr id=" + "infoTableTr" + i + ">");
                var inHospitalApplyId = $("<td>").text(result[i].hospitalization_id);
                var patientName = $("<td>").text(result[i].patient_name);
                var patientSex = $("<td>").text(result[i].patient_sex);
                var sectionName = $("<td>").text(result[i].section_name);
                var optionBtn = $("<td>").html("<input type='button' class='btn btn-primary inHospitalBtn' value='处理' data=" + i + ">");
                queryResultTr.append(inHospitalApplyId).append(patientName).append(patientSex).append(sectionName).append(optionBtn);
                $("#inHospitalApplyInfoTbody").append(queryResultTr);
            }
        }
    });
    //查询出所有要出院的患者的请求
    $.ajax({
        type: "post",
        url: "tao-query-outHospitalInfo",
        dataType: "json",
        async: true,
        success: function (result) {
            console.log(result);
            queryOutResult = result;
            for (var i = 0; i < result.length; i++) {
                var queryResultTr = $("<tr id=" + "outInfoTableTr" + i + ">");
                var outHospitalApplyId = $("<td>").text(result[i].hospitalization_id);
                var patientName = $("<td>").text(result[i].patient_name);
                var patientSex = $("<td>").text(result[i].patient_sex);
                var sectionName = $("<td>").text(result[i].section_name);
                var inHospitalType = $("<td>").text(result[i].hospitalization_type);
                var inHospitalStartTime = $("<td>").text(result[i].hospitalization_time);
                var inHospitalDate = $("<td>").text(result[i].hospitalization_date + "天");
                var optionBtn = $("<td>").html("<input type='button' class='btn btn-primary outHospitalBtn' value='办理出院' data=" + i + ">");
                queryResultTr.append(outHospitalApplyId).append(patientName).append(patientSex).append(sectionName)
                    .append(inHospitalType).append(inHospitalStartTime).append(inHospitalDate).append(optionBtn);
                $("#outHospitalApplyInfoTbody").append(queryResultTr);
            }
        }
    });
    //这是查询出药品申请表的信息
    $.ajax({
        type: "post",
        async: true,
        dataType: "json",
        url: "tao-drugApply-query",
        success: function (result) {
            console.log(result);
            queryDrugApply = result;
            for (var i = 0; i < result.length; i++) {
                var queryResultTr = $("<tr id=" + "druginfoTableTr" + i + ">");
                var drugId = $("<td>").text(result[i].drug_id);
                var drugName = $("<td>").text(result[i].drug_name);
                var patientName = $("<td>").text(result[i].patient_name);
                var patientSex = $("<td>").text(result[i].patient_sex);
                var sectionName = $("<td>").text(result[i].section_name);
                var status = result[i].status;
                if (status == 2) {
                    status = "住院需求";
                } else if (status == 3) {
                    status = "手术需求";
                } else if (status == 4) {
                    status = "手术住院需求";
                }
                var actionName = $("<td>").text(status);
                var applyCount = $("<td>").text(result[i].drug_apply_count);
                var applyTime = $("<td>").text(result[i].apply_time);
                var optionBtn = $("<td>").html("<input type='button' class='btn btn-primary gotoGetDrug' value='去拿药' data=" + i + ">");
                queryResultTr.append(drugId).append(drugName).append(patientName).append(patientSex)
                    .append(sectionName).append(actionName).append(applyCount).append(applyTime).append(optionBtn);
                $("#drugApplyInfoTbody").append(queryResultTr);
            }
        }
    });
    //这是页面通信的vue
    var app = new Vue({
        el: ".main-wrapper",
        created() { // 页面创建生命周期函数
            this.initWebSocket();
        },
        destroyed: function () { // 离开页面生命周期函数
            this.websocketclose();
        },
        data: {
            callAction: "",
            inputContent: ""
        },
        methods: {
            initWebSocket: function () {
                // WebSocket与普通的请求所用协议有所不同，ws等同于http，wss等同于https
                this.websock = new WebSocket("ws://192.168.50.74:8080/websocket/{9004}");
                this.websock.onopen = this.websocketonopen;
                this.websock.onerror = this.websocketonerror;
                this.websock.onmessage = this.websocketonmessage;
                this.websock.onclose = this.websocketclose;
            },
            websocketonopen: function () {
                console.log("WebSocket连接成功");
            },
            websocketonerror: function (e) {
                console.log("WebSocket连接发生错误");
            },
            websocketonmessage: function (e) {
                var showInfo = $("<h1>").text(e.data);
                $(".chat-contents").append(showInfo);
                $("#allContentDiv").hide(200);
                $("#chatBox").show(200);
            },
            websocketclose: function (e) {
                console.log("connection closed (" + e.code + ")");
            },
            sendInfo: function (shipId, message) {
                // 这里只是一个基于axios的ajax请求，你可以换成你的请求格式
                $.ajax({
                    type: "post",
                    url: "test",
                    data: {"shipId": shipId, "message": message},
                    async: true,
                    success: function () {
                    }
                });
            },
            getCallAction: function (e) {
                console.log(e);
                this.callAction = e;
            },
            sentInputMessage: function () {
                var messageContent = this.inputContent;
                var calltarget = this.callAction;
                if (calltarget.length < 1) {
                    layer.alert("请选者部门", {icon: 5});
                } else if (messageContent.length < 1) {
                    layer.alert("请输入消息", {icon: 5});
                } else {
                    messageContent = "来自护士部的消息-->" + messageContent;
                    this.sendInfo(calltarget, messageContent);
                    this.inputContent = "";
                }
            }
        }
    });
    //日期时间选择器
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#test5'
            , type: 'datetime'
        });
    });
    //隐藏那两个柱状图
    $("canvas").hide();
    //隐藏信息
    $("#inHospitalInfoDiv").hide();
    $("#infoWriteTable").hide();
    $("#outHospitalInfoDiv").hide();
    $("#drugApplyInfoDiv").hide();
    $("#chatBox").hide();
    //这是查询按钮
    $("#queryBtn").click(function () {
        var selectVal = $("#querySelectType").val();
        if (selectVal == "inHospitalApply") {
            //展示入院信息
            $("#inHospitalInfoDiv").show(200);
            $("#infoWriteTable").hide(200);
            $("#outHospitalInfoDiv").hide(200);
            $("#drugApplyInfoDiv").hide(200);
        } else if (selectVal == "outHospitalApply") {
            //展示出院信息
            $("#outHospitalInfoDiv").show(200);
            $("#infoWriteTable").hide(200);
            $("#inHospitalInfoDiv").hide(200);
            $("#drugApplyInfoDiv").hide(200);
        } else if (selectVal == "drugApply") {
            $("#drugApplyInfoDiv").show(200);
            $("#inHospitalInfoDiv").hide(200);
            $("#outHospitalInfoDiv").hide(200);
            $("#infoWriteTable").hide(200);
        }
    });
    //这是监听处理办理住院事件的按钮
    $("#inHospitalInfoDiv").on("click", ".inHospitalBtn", function () {
        $("#inHospitalInfoDiv").hide(200);
        $("#infoWriteTable").show(200);
        //往住院表中加入信息
        var index = Number($(this).attr("data"));
        var patientName = queryResult[index].patient_name;
        var sectionId = queryResult[index].section_id;
        var sectionName = queryResult[index].section_name;
        var hospitalizationId = queryResult[index].hospitalization_id;
        var patientId = queryResult[index].patient_id;
        var medicalId = queryResult[index].medical_id;
        $("[name=\"infoTableTrId\"]").val(index);
        $("[name=\"medicalId\"]").val(medicalId);
        $("[name=\"patientId\"]").val(patientId);
        $("[name=\"patientName\"]").val(patientName);
        $("[name=\"sectionId\"]").val(sectionId);
        $("[name=\"sectionName\"]").val(sectionName);
        $("[name=\"hospitalApplyId\"]").val(hospitalizationId);
        //根据科室id获取所有能用的病房对象
        $.ajax({
            type: "post",
            url: "tao-queryWardInfo",
            async: true,
            dataType: "json",
            data: {"sectionId": sectionId},
            success: function (result) {
                $("[name=\"wardId\"]").empty();
                $("[name=\"wardId\"]").append($("<option>").text("--请选择病房号--"));
                for (var i = 0; i < result.length; i++) {
                    var wardId = result[i].ward_id;
                    var wardName = result[i].ward_name;
                    $("<option value=" + wardId + ">").text("病房-->" + wardId + "<--" + wardName).appendTo($("[name=\"wardId\"]"));
                }
            }
        });
    });
    //这是监听床位选择的事件
    $("#infoWriteTable").on("change", "#wardSelect", function () {
        //这是病房号
        var wardSelectVal = $("[name=\"wardId\"]").val();
        $.ajax({
            type: "post",
            url: "tao-querySickbedInfo",
            data: {"wardId": wardSelectVal},
            asynv: true,
            success: function (result) {
                console.log(result);
                $("[name=\"sickbedCode\"]").empty();
                if (result.length < 1) {
                    $("[name=\"sickbedCode\"]").append($("<option value='noEmpty'>").text("--床位已满--"));
                } else {
                    $("[name=\"sickbedCode\"]").append($("<option>").text("--请选择病床号--"));
                    for (var i = 0; i < result.length; i++) {
                        var bedId = result[i].sickbed_id;
                        var bedNum = result[i].sickbed_code;
                        $("<option value=" + bedId + ">").text("病床号-->" + bedNum + "<--").appendTo($("[name=\"sickbedCode\"]"));
                    }
                }
            }
        });
    });
    //这是监听办理出院按钮的功能
    $("#outHospitalApplyInfoTbody").on("click", ".outHospitalBtn", function () {
        var index = Number($(this).attr("data"));
        $.ajax({
            type: "post",
            url: "tao-outHospital-confirm",
            dataType: "json",
            async: true,
            data: {"hosipitalizationInfoId": queryOutResult[index].hospitalization_id},
            success: function (result) {
                layer.msg(result.message, {icon: 6});
                $("#outInfoTableTr" + index).remove();
            }
        });
    });
    //这是监听去拿药的按钮的事件
    $("#drugApplyInfoTbody").on("click", ".gotoGetDrug", function () {
        var index = Number($(this).attr("data"));
        $.ajax({
            type: "post",
            url: "tao-gotoGetDrug",
            dataType: "json",
            async: true,
            data: {"drugApplyId": queryDrugApply[index].drug_apply_id},
            success: function (result) {
                layer.msg(result.message, {icon: 6});
                $("#druginfoTableTr" + index).remove();
            }
        });
    });
    //这是住院表里面的返回按钮功能
    var backBtn = function () {
        $("#inHospitalInfoDiv").show(200);
        $("#infoWriteTable").hide(200);
        $("[name=\"sickbedCode\"]").empty();
    }
    $(".backBtn").click(backBtn);
    //这是提交住院表的请求
    $(".commitBtn").click(function () {
        var bedFlag = $("[name=\"sickbedCode\"]").val();
        if (bedFlag == "noEmpty") {
            layer.msg('床位满了哈哈~~', {icon: 5});
        } else {
            var infoTableTrId = $("[name=\"infoTableTrId\"]").val();
            var hospitalApplyId = $("[name=\"hospitalApplyId\"]").val();
            var patientId = $("[name=\"patientId\"]").val();
            var medicalId = $("[name=\"medicalId\"]").val();
            var sectionId = $("[name=\"sectionId\"]").val();
            var wardId = $("[name=\"wardId\"]").val();
            var bedId = $("[name=\"sickbedCode\"]").val();
            var hospitalizationType = $("[name=\"hospitalizationType\"]").val();
            var inHospitalStartTime = $("[name=\"hospitalizationTime\"]").val();
            var hospitalizationDate = $("[name=\"hospitalizationDate\"]").val();
            var datas = {
                "hospitalApplyId": hospitalApplyId,
                "patientId": patientId,
                "medicalId": medicalId,
                "sectionId": sectionId,
                "wardId": wardId,
                "bedId": bedId,
                "hospitalizationType": hospitalizationType,
                "inHospitalStartTime": inHospitalStartTime,
                "hospitalizationDate": hospitalizationDate
            };
            if (inHospitalStartTime.length > 0 && hospitalizationDate.length > 0) {
                $.ajax({
                    type: "post",
                    async: true,
                    url: "tao-hospital-commit",
                    contentType: 'application/json;charset=utf-8',
                    data: JSON.stringify(datas),
                    dataType: "json",
                    success: function (result) {
                        layer.msg(result.message, {icon: 6});
                        $("#infoTableTr" + infoTableTrId).remove();
                        backBtn();
                    }
                });
            } else {
                layer.msg('请填写住院日期和时长', {icon: 5});
            }
        }
    });
    //这是打开聊天窗口的方法
    $("#chatBtn").click(function () {
        $("#allContentDiv").hide(200);
        $("#chatBox").show(200);
    });
    //这是关闭聊天窗口的方法
    $(".closeCallBox").click(function () {
        $("#allContentDiv").show(200);
        $("#chatBox").hide(200);
    });

    //延迟加载
    $(function () {
        $("#example").dataTable({
            "iDeferLoading": 500
        });
    });

</script>
</body>

</html>